package com.weitu.risk.service.impl;

import com.weitu.risk.entity.Region;
import com.weitu.risk.entity.RegionPoint;
import com.weitu.risk.mapper.RegionPointMapper;
import com.weitu.risk.service.RegionPointService;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RegionPointServiceImpl implements RegionPointService {
    @Autowired
    private RegionPointMapper regionPointMapper;

    @Override
    public List<RegionPoint> queryListByParam(Map<String, Object> map) {
        return this.regionPointMapper.queryListByParam(map);
    }

    @Override
    public int queryListCountByParam(Map<String, Object> map) {
        return this.regionPointMapper.queryListCountByParam(map);
    }

    @Override
    public RegionPoint queryRegionPointById(@Param("id") String id) {
        return this.regionPointMapper.queryRegionPointById(id);
    }

    @Override
    public List<Map<String, Object>> queryComboxList(Map<String, Object> map) {
        return this.regionPointMapper.queryComboxList(map);
    }

    @Override
    public boolean addRegionPoint(Map<String, Object> map) {
        int result = this.regionPointMapper.insertRegionPoint(map);
        if(result<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean editRegionPoint(Map<String, Object> map) {
        int result = this.regionPointMapper.updateRegionPoint(map);
        if(result<1){
            return false;
        }
        return true;
    }

    @Override
    public boolean deleteRegionPointById(@Param("id") String id) {
        int result  = this.regionPointMapper.deleteRegionPointById(id);
        if(result<1){
            return false;
        }
        return true;
    }
}